<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>register</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/register.css">
    <script src="js/jquery-3.1.1.min.js"></script>
    <!-- <link rel="stylesheet" href="css/send_my_message.css"> -->
</head>
<body>
    <div class="head">
            <span class="title">在线驾考模拟系统</span>
            <ul>
                <li><a href="loading.html">登录</a></li>
                <li><a href="register.html">注册</a></li>
            </ul>      
        </div>
    
        <div class="nav">
            <ul>
                <li><a href="index.html">首页</a></li>
                <li><a href="order_exercise.html">顺序练题</a></li>
                <li><a href="error_book.html">错题本</a></li>
                <li><a href="mock_exam.html">模拟测试</a></li>
                <li><a href="message.html">留言板</a></li>
            </ul>
        </div>

        <div class="content">
            <ul>
                <li class="content_span">
                    <span>用户注册</span> 
                </li>
                <li>用&nbsp;&nbsp;户&nbsp;&nbsp;名:&nbsp;&nbsp;&nbsp;
                    <input type="text" style='font-size:20px' placeholder="&nbsp;&nbsp;请输入您的姓名" onfocus="javascript:this.value=''" id="ipt1">
                </li>
                <li>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：&nbsp;
                    <input type="password" style='font-size:20px' placeholder="&nbsp;&nbsp;请输入您的密码" onfocus="javascript:this.value=''" id="ipt2">
                </li>
                <li>确认密码：&nbsp;
                    <input type="password" style='font-size:20px' placeholder="&nbsp;&nbsp;请确认您的密码" onfocus="javascript:this.value=''" id="ipt3">
                </li>
            </ul>
            <div class="register_btn">
                <button class="register_btn_con" id="btn1" onclick="checkform()">提交</button>
            </div>
        </div>
        <script>
            var ipt1 = $('#ipt1')
            var ipt2 = $('#ipt2')
            var ipt3 = $('#ipt3')
        function checkform(){ 
            if(document.getElementById('ipt1').value.length==0){    
                alert('用户名不能为空！');
                document.getElementById('ipt1').focus();
                return false;
            }
            if(document.getElementById('ipt2').value.length==0){    
                alert('密码不能为空！');
                document.getElementById('ipt2').focus();
                return false;
            }
            if(document.getElementById('ipt3').value.length==0){    
                alert('请您再次确认密码！');
                document.getElementById('ipt3').focus();
                return false;
            }
            if(ipt2.val() !== ipt3.val()) {
                alert('两次输入密码不一样')
                return
            }
            alert('注册成功')
            location.href = 'loading.html'
            // $.ajax({
            //     url: "/api/bbs/InsertOrUpdateBbs",           
			// 	dataType: "json",
			// 	async: "true",
			// 	method: "POST",
			// 	data:data,
			// 	success:function(data) {
            //         alert('发送成功')
            //         ipt1.val('')     
            //         ipt3.val('')                      
            //     },               
            //     error:function(e){
            //         console.log(e)
            //     }
            // })
            
        }
        </script>
</body>
</html>